<style type="text/css">
.fieldlist dd{
   display: inline-flex
}
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Event')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-event" class="form-control selectpicker" name="row[event]">
                {foreach name="eventList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.event"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Template_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-template_id" class="form-control" data-rule="required" name="row[template_id]" type="text" value="{$row.template_id|htmlentities}">
        </div>
    </div>

    <div class="form-group json"  >
        <label class="control-label col-xs-12 col-sm-2">{:__('Json')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <dl class="fieldlist" data-name="row[json]"  data-template="wxtpl">
                <dd>
                    <ins style="width:150px">参数</ins>
                    <ins >值类型</ins>
                    <ins >默认值</ins>
                </dd>
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <textarea name="row[json]" class="form-control hide" cols="30" rows="5">{$row.json|htmlentities}</textarea>
            </dl>


        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Page_url')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-page_url" class="form-control" name="row[page_url]" type="text" value="{$row.page_url|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<!--定义模板，模板语法使用Art-Template模板语法-->
<script type="text/html" id="wxtpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][key]" class="form-control" value="<%=row['key']%>" style="width: 150px;float:left;margin-right: 10px;"> 
        <select   class="form-control selectpicker" name="row[<%=name%>][<%=index%>][type]"  style="width: 90px;float:left;margin-right: 10px;">
                {foreach name="itemList" item="vo"}
                    <option value="{$key}" type="<%=row['type']%>"  >{$vo}</option>
                {/foreach}
        </select>
        <input type="text" name="row[<%=name%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" style="width: 90px;float:left;margin-left: 10px;">  
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>